package cn.gpnusz.oliverwiki.service;

import cn.gpnusz.oliverwiki.mapper.MyEbookSnapshotMapper;
import cn.gpnusz.oliverwiki.resp.EbookSnapshotResp;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author h0ss
 * @description 电子书快照的业务层
 * @date 2021/10/28 1:44
 */
@Service
public class EbookSnapshotService {
    @Resource
    private MyEbookSnapshotMapper myEbookSnapshotMapper;

    /**
     * 生成电子书快照的业务方法
     *
     * @author h0ss
     */
    public void generateSnapshot() {
        myEbookSnapshotMapper.generateSnapshot();
    }

    /**
     * 获取电子书快照表的信息
     * @return : java.util.List<cn.gpnusz.oliverwiki.resp.EbookSnapshotResp>
     * @author h0ss
     */
    public List<EbookSnapshotResp> getStaticData(){
        return myEbookSnapshotMapper.getStaticData();
    }

    /**
     * 获取过去三十天的点赞阅读数据
     * @return : java.util.List<cn.gpnusz.oliverwiki.resp.EbookSnapshotResp>
     * @author h0ss
     */
    public List<EbookSnapshotResp> getThirtyStaticData(){
        return myEbookSnapshotMapper.getThirtyStaticData();
    }
}
